//SKU模块的接口管理
import request  from "@/utils/request";
import type{SkuResponseData} from "./type";
enum API {
//获取已有的商品的数据_sku
SKU_URL='/admin/product/list/',

//商品下架
CANCELASLE_URL = '/admin/product/cancelSale/' ,
//商品上架
ONSALE_URL = '/admin/product/onSale/',
//详情接口
SKUINFO_URL = '/admin/product/getSkuInfo/' ,





//删除已有商品sku数据
DELETESKU_URL='/admin/product/deleteSku/'
}

//获取商品sku的接口
export const reqSkuList = (page: number,limit:number)=>request.get<any,SkuResponseData>(API.SKU_URL+`${page}/${limit}`)
// 商品下架的接口
export const reqCancelSale = (skuId: number)=>request.get<any,any>(API.CANCELASLE_URL + skuId)
//商品上架
export const reqOnSale = (skuId: number)=>request.get<any,any>(API.ONSALE_URL + skuId)
//商品详情
export const reqSkuInfo = (skuId: number)=>request.get<any,any>(API.SKUINFO_URL + skuId)




//删除商品的接口
export const reqDeleteSku = (skuId:number)=>request.delete<any,any>(API.DELETESKU_URL + skuId)
